<?php

namespace app\shop\controller;

use app\Base;
use app\service\shop\PayServices;
use app\tools\Logs;
use think\response\view;
use think\response\Json;

/**
 * 商品
 * User : Du
 * Date : 2022/11/30
 * Time : 12:27
 * Class Goods
 * @package projects\controller\shop
 */
class Goods extends Base
{


    /**
     * 支付宝测试
     * User : Du
     * Date : 2022/11/30
     * Time : 16:14
     * @param PayServices $services
     * @return Json
     */
    public function aliPay(PayServices $services): Json
    {
        $res = $services::ZfbPay($this->params);
        $this->res['data']['form'] = $res;
        return $this->returnData();
//         view('/home/shop/aliPay',  ['data' => $res]);
    }

    /**
     * 支付宝支付回调
     * User : Du
     * Date : 2022/11/30
     * Time : 16:59
     * @return Json
     */
    public function aliPayCallback(): Json
    {
        $params = input();
        Logs::info('支付宝支付回调', ['data' => $params], 'aliPay', '/shopPay');
        return $this->returnData();
    }
}